package com.jemframework.domain.propertyconverter;

public class IntegerPropertyConverter extends AbstractPropertyConverter {

  public Object getAsObject(String string) {
    if (string == null || string.trim().length() == 0) {
      return null;
    }

    return Integer.valueOf(string);
  }

  public String getAsString(Object property) {
    if (property == null) {
      return "";
    }

    Integer i = (Integer) property;
    return i.toString();
  }
}
